<?php

/**

 * Created by PhpStorm.

 * User: zhoujun

 * Date: 2018/9/1

 * Time: 11:58

 */



namespace addons\faqueue\library\jobs;



use addons\faqueue\model\FaqueueLog;
use app\admin\model\gongcheng\xiangmu\Chengben;
use think\Log;

use think\queue\job;
use CURLFile;
use think\Db;
use think\Exception;
use fast\GoodsAdd;

class GoodsSave

{

    public function fire(Job $job, $data){





        $ret = false;

        

        try {
            GoodsAdd::addData($data);


        } catch (Exception $e) {
             logs('GoodsSave',json_encode($data).'-----队列报错'.$e->getError());    
        }


        $job->delete();
        (new FaqueueLog())->log($job->getQueue(),$job->getName(),$data);


    }



     public function failed($data){

        Log::write("链账户上链失败".print_r(['data' => $data,],true),'error');

    }

}